---
title: "SQL-029: CP external client lookup"
summary: Retrieve an external client email address from the BDS client lookup.
status: draft
owner: SAIF Corporation
last_reviewed: 2026-08-21
library: SAIF.Business.View.Policy
reference_type: embedded
---

# SQL-029 CP external client lookup

This stored procedure call retrieves an external client email address for a service-team member when the member is not a SAIF internal user.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-029 |
| **Operation type** | Read |
| **Execution method** | StoredProc |
| **Database** | SQL Server (BDS) |
| **Schema** | `[unqualified]**` |
| **Command type** | StoredProcedure |
| **Business object** | `clsTeamAssignment` |
| **Criteria property** | `N/A` |
| **Lifecycle method** | `InitializeEmailAddress` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `@idNum` | Input | Decimal | N/A | External client identifier used for lookup. |
| `@clientLastname` | Input | String | N/A | External client last name used to refine the lookup. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| N/A — Stored procedure | SELECT | Procedure body resides in the database. |

## Sample SQL

```sql
-- SQL Server (BDS) stored procedure call (CommandType.StoredProcedure, ResultSet)
-- clsTeamAssignment.InitializeEmailAddress, executed against the caller-supplied SQL Server DPI
EXEC cp_external_client_lookup
  @idNum          = @idNum,
  @clientLastname = @clientLastname
-- returns column: EMAIL_ADDR
```

> The procedure body resides in the SQL Server (BDS) database; it was not retrievable for this run.

## Operations and processes
- [Retrieve service team](../operations-processes.md)

## Business rules
- [BR-VP-010: Demo users see masked data](../business-rules.md#br-vp-010-demo-users-see-masked-data)
- [BR-VP-022: Team member email address derivation](../business-rules.md#br-vp-022-team-member-email-address-derivation)

## Sources
- `SAIF.Business.View.Policy/clsTeamAssignment.vb`
